package service.Register;

public class RegisterResult {
    public enum Status {
        SUCCESS, USER_EXISTS, INVALID_INPUT, ERROR
    }

    private final Status status;
    private final String message;

    private RegisterResult(Status status, String message) {
        this.status = status;
        this.message = message;
    }

    public static RegisterResult success() {
        return new RegisterResult(Status.SUCCESS, "注册成功");
    }

    public static RegisterResult userExists(String username) {
        return new RegisterResult(Status.USER_EXISTS, "用户名已存在: " + username);
    }

    public static RegisterResult invalidInput(String message) {
        return new RegisterResult(Status.INVALID_INPUT, message);
    }

    public static RegisterResult error(String message) {
        return new RegisterResult(Status.ERROR, message);
    }

    // Getters
    public Status getStatus() { return status; }
    public String getMessage() { return message; }
}